package com.example.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.mapper.CourseMapper;
import com.example.demo.model.entity.CourseEntity;
import com.example.demo.model.param.CourseParam;
import com.example.demo.service.CourseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CourseServiceImpl extends ServiceImpl<CourseMapper,CourseEntity> implements CourseService {



    @Autowired
    private CourseMapper courseMapper;

    @Override
    public PageInfo selectCourseList(CourseParam courseParam) {
        PageHelper.startPage(courseParam.getPage(),courseParam.getLimit());
        List list = courseMapper.selectCourseList(courseParam);
        PageInfo<CourseEntity> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
